#include<iostream>
using namespace std;
const int N = 1e5 + 10;
int w[110], f[110][N];
int n;
int main()
{
	cin >> n;
	int sum = 0;
	for (int i = 1; i <= n; i++) {
		cin >> w[i];
		sum += w[i];
	}
	for (int i = 1; i <= n; i++) {
		for (int j = sum; j >= 1; j--) {
			if (j == w[i])f[i][j] = 1;
			else if (f[i - 1][j + w[i]])f[i][j] = 1;
			else if (f[i - 1][abs(j - w[i])])f[i][j] = 1;
			else if (f[i - 1][j])f[i][j] = 1;
			//cout << "i==" << i << "  j==" << j << "  f[i][j]==" << f[i][j] << endl;
		}
	}
	int ans = 0;
	for (int i = 1; i <= sum; i++) {
		if (f[n][i])ans++;
	}
	cout << ans << endl;
	return 0;
}